<template>
  <div class="wgs_wrap">
    <div class="wgs_search flex">
      <div class="my_reimbursement">我的报销</div>
      <div class="search_box flex_end">
        <template>
          <div class="block">
            <el-date-picker
              class="starttimes"
              v-model="dateTimes"
              type="daterange"
              align="right"
              unlink-panels
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :picker-options="pickerOptions">
            </el-date-picker>
          </div>
        </template>
        &nbsp;&nbsp;&nbsp;
        <el-button type="primary" size="small" round>查询</el-button>
        <el-button type="primary" size="small" round>重置</el-button>
        <el-button type="primary" size="small" round>发起报销</el-button>
        &nbsp;&nbsp;&nbsp;
      </div>
    </div>

    <div class="wgs_content">
      <template>
        <el-tabs :tab-position="tabPosition">
          <el-tab-pane label="日常报销">
            <div class="table">
              <div class="title">日常报销明细</div>
              <div class="table_head flex">
                <div class="items">报销金额(元)</div>
                <div class="items">费用发生日期</div>
                <div class="items">费用类型</div>
                <div class="items">费用说明</div>
                <div class="items">附件</div>
                <div class="items">归属人</div>
                <div class="items">审批结果</div>
                <div class="items">当前节点</div>
                <div class="items">当前负责人</div>
              </div>
              <div class="table_body flex" 
                  v-for="(item,index) in 20" 
                  :key="index" 
                  :class="index%2 > 0 ? 'background_f2':''"
                  @click="toDetails(item)">
                <div class="items_body accounts">2109.23</div>
                <div class="items_body">2022-12-21</div>
                <div class="items_body applu_type">日常报销</div>
                <div class="items_body description">吃饭</div>
                <div class="items_body file">head.jpg</div>
                <div class="items_body">张三</div>
                <div class="items_body result">审核通过</div>
                <div class="items_body">审批人</div>
                <div class="items_body">当前负责人</div>
              </div>
              <div class="table_gagination">
                <el-pagination
                  background
                  layout="prev, pager, next"
                  :total="1000">
                </el-pagination>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="差旅报销">
            <div class="table">
              <div class="title">日常报销明细</div>
              <div class="table_head flex">
                <div class="items">报销金额(元)</div>
                <div class="items">费用发生日期</div>
                <div class="items">费用类型</div>
                <div class="items">费用说明</div>
                <div class="items">附件</div>
                <div class="items">归属人</div>
                <div class="items">审批结果</div>
                <div class="items">当前节点</div>
                <div class="items">当前负责人</div>
              </div>
              <div class="table_body flex" 
                v-for="(item,index) in 20" 
                :key="index" 
                @click="toDetails(item)"
                :class="index%2 > 0 ? 'background_f2':''">
                <div class="items_body accounts">5467.12</div>
                <div class="items_body">2021-1-21</div>
                <div class="items_body applu_type">差旅报销</div>
                <div class="items_body description">睡觉</div>
                <div class="items_body file">head.jpg</div>
                <div class="items_body">李四</div>
                <div class="items_body result">审核通过</div>
                <div class="items_body">审批人</div>
                <div class="items_body">当前负责人</div>
              </div>
              <div class="table_gagination">
                <el-pagination
                  background
                  layout="prev, pager, next"
                  :total="1000">
                </el-pagination>
              </div>
            </div>
          </el-tab-pane>
        </el-tabs>
      </template>
    </div>
    <!-- 报销详情弹窗 -->
    <el-dialog title="吴冠圣提交的日常报销" 
      width="60%"
      :visible.sync="dialogTableVisible">
      <div class="baoxiao_content flex">
        <div class="baoxiao_content_left">
          <div class="number">审批编号</div>
          <div class="numbers">20220203203028473</div>
          <div class="height8"></div>
          <div class="number">所在部门</div>
          <div class="numbers">研发部</div>
          <div class="height8"></div>
          <div class="number">报销金额</div>
          <div class="numbers">2319.12</div>
          <div class="height8"></div>
          <div class="number">费用发生日期</div>
          <div class="numbers">2022-12-3</div>
          <div class="height8"></div>
          <div class="number">费用类型</div>
          <div class="numbers">日常报销/餐饮</div>
          <div class="height8"></div>
          <div class="number">费用说明</div>
          <div class="numbers">吃饭</div>
          <div class="height8"></div>
          <div class="number">附件</div>
          <div class="numbers">文件名称及其大小</div>
          <div class="line"></div>
          <div class="number">报销总金额</div>
          <div class="number">大写：</div>
        </div>
        <div class="baoxiao_content_right">
          <div class="number">流程</div>
          <div class="first_items flex">
            <div class="header">
              <img src="../../../assets/imgs/header.png">
            </div>
            <div class="dui posisahk">
              <img class="dui" src="../../../assets/imgs/dui.png">
            </div>
            <div class="description_name">
              <p>吴冠圣</p>
              <p>发起申请</p>
            </div>
            <div class="start_time">
              <p>2022-12-23 12:30</p>
              <p></p>
            </div>
          </div>
          <div class="shuxian"></div>
          <div class="first_items flex">
            <div class="header">
              <img src="../../../assets/imgs/header.png">
            </div>
            <div class="dui posisahk">
              <img class="dui" src="../../../assets/imgs/pinglun.png">
            </div>
            <div class="description_name1">
              <p>xxx添加了评论</p>
              <p class="comment">测试评论</p>
            </div>
          </div>
          <div class="shuxian"></div>
          <div class="first_items flex">
            <div class="header">
              <img src="../../../assets/imgs/header.png">
            </div>
            <div class="dui posisahk">
              <img class="dui" src="../../../assets/imgs/diandian.png">
            </div>
            <div class="description_name1">
              <p>2人依次审批（审批中）</p>
              <p>审批人</p>
            </div>
            <div :class="showFlag?'up_box1':'up_box'" @click="showInfo"><img src="../../../assets/imgs/up.png"></div>
          </div>
          <div class="shuxian"></div>
          <div class="approvers flex" v-show="showFlag">
            <div class="approver">
              <img src="../../../assets/imgs/header.png">
            </div>
            <img class="dui1" src="../../../assets/imgs/dui.png">
            <div class="approver">
              <img src="../../../assets/imgs/header.png">
            </div>
             <img class="dui1" src="../../../assets/imgs/dui.png">
            <div class="approver">
              <img src="../../../assets/imgs/header.png">
            </div>
             <img class="dui1" src="../../../assets/imgs/dui.png">
          </div>
          <div class="first_items flex">
            <div class="header">
              <img src="../../../assets/imgs/header.png">
            </div>
            <div class="dui posisahk">
            </div>
            <div class="description_name1">
              <p>xxx</p>
              <p>付款确认</p>
            </div>
          </div>
          <div class="shuxian"></div>
           <div class="first_items flex">
            <div class="header">
              <img src="../../../assets/imgs/header.png">
            </div>
            <div class="dui posisahk">
              <img class="dui" src="../../../assets/imgs/diandian.png">
            </div>
            <div class="description_name1">
              <p>传阅1人</p>
              <p>传阅人</p>
            </div>
            <div :class="showFlag1?'up_box1':'up_box'" @click="showInfo1"><img src="../../../assets/imgs/up.png"></div>
          </div>
          <div class="shuxian"></div>
          <div class="approvers flex" v-show="showFlag1">
            <div class="approver">
              <img src="../../../assets/imgs/header.png">
            </div>
            <img class="dui1" src="../../../assets/imgs/dui.png">
            <div class="approver">
              <img src="../../../assets/imgs/header.png">
            </div>
             <img class="dui1" src="../../../assets/imgs/dui.png">
            <div class="approver">
              <img src="../../../assets/imgs/header.png">
            </div>
             <img class="dui1" src="../../../assets/imgs/dui.png">
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {getMyTask} from "@/api/workFlow/WFProcess";
export default {
  name: "Reimbursement1",
  data() {
    return {
      tabPosition: 'top',
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            picker.$emit('pick', [start, end]);
          }
        }]
      },
      dateTimes: '',
      dialogTableVisible: false,
      showFlag:true,
      showFlag1:true
    };
  },
  created() {},
  methods: {
    toDetails(item){
      this.dialogTableVisible = true
    },
    showInfo(){
      this.showFlag = !this.showFlag
    },
    showInfo1(){
      this.showFlag1 = !this.showFlag1
    }
  },
};
</script>
<style scoped>
.border {
  border: 1px solid red;
}
.wgs_search {
  margin: 0 8px;
  height: 40px;
  background: #fff;
}
.flex {
  display: flex;
  flex-direction: row;
}
.wgs_content{
  margin: 8px;
  background: #fff;
}
.title{
  height: 24px;
  margin: 8px;
  font-size: 16px;
  color: #666;
  line-height: 24px;
}
.table_head{
  height: 28px;
  margin: 8px;
  background: #f2f2f2;
  border-radius: 4px;
}
.background_f2{
  background: #f2f2f2;
}
.table_body{
  height: 32px;
  border-radius: 4px;
}
.table_body:hover{
  cursor: pointer;
}
.items{
  width: 150px;
  height: 16px;
  margin-top: 6px;
  border-right: 1px solid #999;
  color: #666;
  font-size: 14px;
  line-height: 16px;
  text-align: center;
}
.items_body{
  width: 150px;
  height: 32px;
  font-size: 16px;
  line-height: 32px;
  text-align: center;
}
.table_gagination{
  height: 40px;
  background: #fff;
  text-align: center;
  margin: 12px 12px;
}
.accounts{
  color: rgb(255, 95, 1);
}
.applu_type{
  color: #0063f5;
}
.description{
  color: #77a632;
}
.file{
  color: red;
}
.result{
  color: #67C23A;
}
.my_reimbursement{
  font-size: 16px;
  line-height: 40px;  
  text-indent: 2em;
  width: 10%;
}
.flex_end{
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}
.search_box{
  height: 30px;
  width: 85%;
  margin-top: 5px;
}
.starttimes,.block{
  height: 30px;
}
.starttimes{
  margin-right: 12px;
}
.baoxiao_content{
  width: 100%;
}
.baoxiao_content_left{
  width: 60%;
}
.baoxiao_content_right{
  width: 40%;
}
.number{
  color: #666;
  font-size: 16px;
}
.numbers{
  width: 90%;
  height: 30px;
  background: #f2f2f2;
  color: #999;
  font-size: 16px;
  line-height: 30px;
  text-indent: 1em;
}
.height8{
  height: 8px;
}
.line{
  width: 90%;
  height: 2px;
  background: #f2f2f2;
  margin: 12px 0;
}
.first_items{
  width: 90%;
  height: 64px;
}
.header{
  width: 64px;
  height: 64px;
  border-radius: 4px;
}
.description_name{
  width: 128px;
  height: 64px;
  border-radius: 4px;
}
.description_name1{
  width: 300px;
  height: 64px;
  border-radius: 4px;
}
.start_time{
  width: 128px;
  height: 64px;
  border-radius: 4px;
  
}
.description_name > p{
  margin: 0;
  padding: 0;
}
.description_name1 > p{
  margin: 0;
  padding: 0;
}
.comment{
  background: #f2f2f2;
  text-indent: 1em;
}
.start_time > p{
  margin: 0;
  padding: 0;
}
.header > img{
  width: 64px;
  height: 64px;
  border-radius: 4px;
}
.dui{
  width: 24px;
  height: 24px;
}
.dui1{
  width: 12px;
  height: 12px;
  position: relative;
  left: -5px;
  top: 28px;
}
.posisahk{
  position: relative;
  top: 45px;
  left: -12px;
}
.shuxian{
  width: 32px;
  height: 40px;
  margin: 4px 0;
  border-right: 2px dashed #f2f2f2;
}
.up_box > img{
  width: 24px;
  height: 24px;
}
.up_box1 > img{
  width: 24px;
  height: 24px;
  transform: rotate(180deg);
}
.approvers{
  height: 64px;
  position: relative;
  left: 90px;
  top: -30px;
}
.approver{
  width: 32px;
  height: 32px;
  margin-left: 12px;
}
.approver > img{
  width: 100%;
  height: 100%;
}
</style>
